	<h3><?php echo lang('cirpho_group_list_title'); ?></h3>
	<?php echo form_open_multipart('admin/cirpho/import', 'class="crud" id="import-group"'); ?>
	<fieldset>
	<ol>
		<li class="even">
			<?php echo  form_upload('import'); ?>
			<div class="buttons align-left padding-top">
			<?php echo form_button(array(
			    'name' => 'import-submit',
			    'id' => 'import-submit',
			    'class' =>'button',
			    'value' => 'true',
			    'type' => 'submit',
			    'content' => '<span>Import</span>'
			))?>
			</div>
		</li>
	</ol>
	
	</fieldset>
	
	<?php echo form_close(); ?>
	<div class="align-left buttons buttons-small">
	<?php echo anchor('admin/cirpho/create/', lang('cirpho_group_create_title'), 'class="button add"'); ?>
	</div>
<?php if ($groups): ?>
	<?php echo form_open('admin/cirpho/delete'); ?>

	<table border="0" class="table-list">
		<thead>
		<tr>
			<th width="20"><?php echo form_checkbox(array('name' => 'action_to_all', 'class' => 'check-all')); ?></th>
			<th><?php echo lang('cirpho_group_id_label'); ?></th>
			<th><?php echo lang('cirpho_group_title_label'); ?></th>
			<th><?php echo lang('cirpho_group_sample_label'); ?></th>
			<th><?php echo anchor('admin/cirpho/index/o.name/'.$order, lang('cirpho_group_owner_label'), 'class="order-'.$order.'"'); ?></th>
			<!-- <th><a href=""><?php echo lang('cirpho_group_owner_label'); ?></a></th> -->
			<th><?php echo lang('cirpho_group_category_label'); ?></th>
			<th><?php echo anchor('admin/cirpho/index/create_date/'.$order, lang('cirpho_group_created_date_label'), 'class="order-'.$order.'"'); ?></th>
			<!-- <th><?php echo lang('cirpho_group_created_date_label'); ?></th>-->
			<th><?php echo lang('cirpho_group_valid_label'); ?></th>
			<th width="200" class="align-center"><span><?php echo lang('cirpho_group_actions_label'); ?></span></th>
		</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="9">
					<div class="inner"><?php $this->load->view('admin/partials/pagination'); ?></div>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<?php foreach ($groups as $group): ?>
			<tr>
				<td><?php echo form_checkbox('action_to[]', $group->id); ?></td>
				<td><?php echo $group->id; ?></td>
				<td><?php echo $group->title; ?></td>
				<td>
					<?php echo anchor('admin/cirpho/samples/manage/'.$group->id, lang('cirpho_group_manage_label'), 'class="button add"'); ?>
				</td>
				<td>
				<?php
					if(isset($owners) && count($owners) > 0){
						foreach ($owners as $owner) {
							if($owner->id == $group->owner_id){
								echo $owner->name;
								break;
							}
						}
					} 
				?>
				</td>
				<td>
				<?php
					if(isset($categories) && count($categories) > 0){
						foreach ($categories as $category) {
							if($category->id == $group->category_id){
								echo $category->name;
								break;
							}
						}
					} 
				?>
				</td>
				<td>
				<?php echo date("Y/m/d", $group->create_date)?>
				</td>
				<td>
				<?php echo form_checkbox('valid', 1, $group->valid?TRUE:FALSE);?>
				</td>
				<td class="align-center buttons buttons-small">
					<?php echo anchor('admin/cirpho/edit/' . $group->id, lang('cirpho_group_edit_label'), 'class="button edit"'); ?>
					<?php echo anchor('admin/cirpho/delete/' . $group->id, lang('cirpho_group_delete_label'), 'class="confirm button delete"') ;?>
				</td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>

	<div class="buttons align-left padding-top">
		<?php $this->load->view('admin/partials/buttons', array('buttons' => array('delete') )); ?>
	</div>

	<?php echo form_close(); ?>

<?php else: ?>
	<div class="blank-slate">
		<h2><?php echo lang('cirpho_group_no_group'); ?></h2>
	</div>
<?php endif; ?>